3.5.48 \(\int (a+b \tan (c+d x))^4 \, dx\) [448]

Optimal. Leaf size=103 \[ \left (a^4-6 a^2 b^2+b^4\right ) x-\frac {4 a b \left (a^2-b^2\right ) \log (\cos (c+d x))}{d}+\frac {b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}+\frac {a b (a+b \tan (c+d x))^2}{d}+\frac {b (a+b \tan (c+d x))^3}{3 d} \]

[Out]

(a^4-6*a^2*b^2+b^4)*x-4*a*b*(a^2-b^2)*ln(cos(d*x+c))/d+b^2*(3*a^2-b^2)*tan(d*x+c)/d+a*b*(a+b*tan(d*x+c))^2/d+1
/3*b*(a+b*tan(d*x+c))^3/d

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3563, 3609, 3606, 3556} \begin {gather*} \frac {b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}-\frac {4 a b \left (a^2-b^2\right ) \log (\cos (c+d x))}{d}+x \left (a^4-6 a^2 b^2+b^4\right )+\frac {b (a+b \tan (c+d x))^3}{3 d}+\frac {a b (a+b \tan (c+d x))^2}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Tan[c + d*x])^4,x]

[Out]

(a^4 - 6*a^2*b^2 + b^4)*x - (4*a*b*(a^2 - b^2)*Log[Cos[c + d*x]])/d + (b^2*(3*a^2 - b^2)*Tan[c + d*x])/d + (a*
b*(a + b*Tan[c + d*x])^2)/d + (b*(a + b*Tan[c + d*x])^3)/(3*d)

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3563

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((a + b*Tan[c + d*x])^(n - 1)/(d*(n - 1))
), x] + Int[(a^2 - b^2 + 2*a*b*Tan[c + d*x])*(a + b*Tan[c + d*x])^(n - 2), x] /; FreeQ[{a, b, c, d}, x] && NeQ
[a^2 + b^2, 0] && GtQ[n, 1]

Rule 3606

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[b*d*(Tan[e + f*x]/f), x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3609

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*
((a + b*Tan[e + f*x])^m/(f*m)), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rubi steps

\begin {align*} \int (a+b \tan (c+d x))^4 \, dx &=\frac {b (a+b \tan (c+d x))^3}{3 d}+\int (a+b \tan (c+d x))^2 \left (a^2-b^2+2 a b \tan (c+d x)\right ) \, dx\\ &=\frac {a b (a+b \tan (c+d x))^2}{d}+\frac {b (a+b \tan (c+d x))^3}{3 d}+\int (a+b \tan (c+d x)) \left (a \left (a^2-3 b^2\right )+b \left (3 a^2-b^2\right ) \tan (c+d x)\right ) \, dx\\ &=\left (a^4-6 a^2 b^2+b^4\right ) x+\frac {b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}+\frac {a b (a+b \tan (c+d x))^2}{d}+\frac {b (a+b \tan (c+d x))^3}{3 d}+\left (4 a b \left (a^2-b^2\right )\right ) \int \tan (c+d x) \, dx\\ &=\left (a^4-6 a^2 b^2+b^4\right ) x-\frac {4 a b \left (a^2-b^2\right ) \log (\cos (c+d x))}{d}+\frac {b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}+\frac {a b (a+b \tan (c+d x))^2}{d}+\frac {b (a+b \tan (c+d x))^3}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.38, size = 105, normalized size = 1.02 \begin {gather*} \frac {-3 i (a+i b)^4 \log (i-\tan (c+d x))+3 i (a-i b)^4 \log (i+\tan (c+d x))-6 b^2 \left (-6 a^2+b^2\right ) \tan (c+d x)+12 a b^3 \tan ^2(c+d x)+2 b^4 \tan ^3(c+d x)}{6 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Tan[c + d*x])^4,x]

[Out]

((-3*I)*(a + I*b)^4*Log[I - Tan[c + d*x]] + (3*I)*(a - I*b)^4*Log[I + Tan[c + d*x]] - 6*b^2*(-6*a^2 + b^2)*Tan
[c + d*x] + 12*a*b^3*Tan[c + d*x]^2 + 2*b^4*Tan[c + d*x]^3)/(6*d)

________________________________________________________________________________________

Maple [A]
time = 0.03, size = 107, normalized size = 1.04

method result size
norman \(\left (a^{4}-6 a^{2} b^{2}+b^{4}\right ) x +\frac {b^{2} \left (6 a^{2}-b^{2}\right ) \tan \left (d x +c \right )}{d}+\frac {b^{4} \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}+\frac {2 a \,b^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{d}+\frac {2 a b \left (a^{2}-b^{2}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d}\) \(103\)
derivativedivides \(\frac {\frac {b^{4} \left (\tan ^{3}\left (d x +c \right )\right )}{3}+2 a \,b^{3} \left (\tan ^{2}\left (d x +c \right )\right )+6 a^{2} b^{2} \tan \left (d x +c \right )-b^{4} \tan \left (d x +c \right )+\frac {\left (4 a^{3} b -4 a \,b^{3}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (a^{4}-6 a^{2} b^{2}+b^{4}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) \(107\)
default \(\frac {\frac {b^{4} \left (\tan ^{3}\left (d x +c \right )\right )}{3}+2 a \,b^{3} \left (\tan ^{2}\left (d x +c \right )\right )+6 a^{2} b^{2} \tan \left (d x +c \right )-b^{4} \tan \left (d x +c \right )+\frac {\left (4 a^{3} b -4 a \,b^{3}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (a^{4}-6 a^{2} b^{2}+b^{4}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) \(107\)
risch \(4 i a^{3} b x -4 i a \,b^{3} x +a^{4} x -6 a^{2} b^{2} x +b^{4} x +\frac {8 i a^{3} b c}{d}-\frac {8 i a \,b^{3} c}{d}-\frac {4 i b^{2} \left (-9 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+6 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-18 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+6 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}-9 a^{2}+2 b^{2}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}-\frac {4 b \,a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}+\frac {4 b^{3} a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(218\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(d*x+c))^4,x,method=_RETURNVERBOSE)

[Out]

1/d*(1/3*b^4*tan(d*x+c)^3+2*a*b^3*tan(d*x+c)^2+6*a^2*b^2*tan(d*x+c)-b^4*tan(d*x+c)+1/2*(4*a^3*b-4*a*b^3)*ln(1+
tan(d*x+c)^2)+(a^4-6*a^2*b^2+b^4)*arctan(tan(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.52, size = 113, normalized size = 1.10 \begin {gather*} a^{4} x - \frac {6 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a^{2} b^{2}}{d} + \frac {{\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} b^{4}}{3 \, d} - \frac {2 \, a b^{3} {\left (\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )}}{d} + \frac {4 \, a^{3} b \log \left (\sec \left (d x + c\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(d*x+c))^4,x, algorithm="maxima")

[Out]

a^4*x - 6*(d*x + c - tan(d*x + c))*a^2*b^2/d + 1/3*(tan(d*x + c)^3 + 3*d*x + 3*c - 3*tan(d*x + c))*b^4/d - 2*a
*b^3*(1/(sin(d*x + c)^2 - 1) - log(sin(d*x + c)^2 - 1))/d + 4*a^3*b*log(sec(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 0.73, size = 100, normalized size = 0.97 \begin {gather*} \frac {b^{4} \tan \left (d x + c\right )^{3} + 6 \, a b^{3} \tan \left (d x + c\right )^{2} + 3 \, {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} d x - 6 \, {\left (a^{3} b - a b^{3}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 3 \, {\left (6 \, a^{2} b^{2} - b^{4}\right )} \tan \left (d x + c\right )}{3 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(d*x+c))^4,x, algorithm="fricas")

[Out]

1/3*(b^4*tan(d*x + c)^3 + 6*a*b^3*tan(d*x + c)^2 + 3*(a^4 - 6*a^2*b^2 + b^4)*d*x - 6*(a^3*b - a*b^3)*log(1/(ta
n(d*x + c)^2 + 1)) + 3*(6*a^2*b^2 - b^4)*tan(d*x + c))/d

________________________________________________________________________________________

Sympy [A]
time = 0.12, size = 131, normalized size = 1.27 \begin {gather*} \begin {cases} a^{4} x + \frac {2 a^{3} b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} - 6 a^{2} b^{2} x + \frac {6 a^{2} b^{2} \tan {\left (c + d x \right )}}{d} - \frac {2 a b^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} + \frac {2 a b^{3} \tan ^{2}{\left (c + d x \right )}}{d} + b^{4} x + \frac {b^{4} \tan ^{3}{\left (c + d x \right )}}{3 d} - \frac {b^{4} \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tan {\left (c \right )}\right )^{4} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(d*x+c))**4,x)

[Out]

Piecewise((a**4*x + 2*a**3*b*log(tan(c + d*x)**2 + 1)/d - 6*a**2*b**2*x + 6*a**2*b**2*tan(c + d*x)/d - 2*a*b**
3*log(tan(c + d*x)**2 + 1)/d + 2*a*b**3*tan(c + d*x)**2/d + b**4*x + b**4*tan(c + d*x)**3/(3*d) - b**4*tan(c +
 d*x)/d, Ne(d, 0)), (x*(a + b*tan(c))**4, True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1071 vs. \(2 (101) = 202\).
time = 0.94, size = 1071, normalized size = 10.40 \begin {gather*} \frac {3 \, a^{4} d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 18 \, a^{2} b^{2} d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} + 3 \, b^{4} d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 6 \, a^{3} b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{3} \tan \left (c\right )^{3} + 6 \, a b^{3} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 9 \, a^{4} d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 54 \, a^{2} b^{2} d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 9 \, b^{4} d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 6 \, a b^{3} \tan \left (d x\right )^{3} \tan \left (c\right )^{3} + 18 \, a^{3} b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 18 \, a b^{3} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 18 \, a^{2} b^{2} \tan \left (d x\right )^{3} \tan \left (c\right )^{2} + 3 \, b^{4} \tan \left (d x\right )^{3} \tan \left (c\right )^{2} - 18 \, a^{2} b^{2} \tan \left (d x\right )^{2} \tan \left (c\right )^{3} + 3 \, b^{4} \tan \left (d x\right )^{2} \tan \left (c\right )^{3} + 9 \, a^{4} d x \tan \left (d x\right ) \tan \left (c\right ) - 54 \, a^{2} b^{2} d x \tan \left (d x\right ) \tan \left (c\right ) + 9 \, b^{4} d x \tan \left (d x\right ) \tan \left (c\right ) + 6 \, a b^{3} \tan \left (d x\right )^{3} \tan \left (c\right ) - 6 \, a b^{3} \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 6 \, a b^{3} \tan \left (d x\right ) \tan \left (c\right )^{3} - b^{4} \tan \left (d x\right )^{3} - 18 \, a^{3} b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right ) \tan \left (c\right ) + 18 \, a b^{3} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right ) \tan \left (c\right ) + 36 \, a^{2} b^{2} \tan \left (d x\right )^{2} \tan \left (c\right ) - 9 \, b^{4} \tan \left (d x\right )^{2} \tan \left (c\right ) + 36 \, a^{2} b^{2} \tan \left (d x\right ) \tan \left (c\right )^{2} - 9 \, b^{4} \tan \left (d x\right ) \tan \left (c\right )^{2} - b^{4} \tan \left (c\right )^{3} - 3 \, a^{4} d x + 18 \, a^{2} b^{2} d x - 3 \, b^{4} d x - 6 \, a b^{3} \tan \left (d x\right )^{2} + 6 \, a b^{3} \tan \left (d x\right ) \tan \left (c\right ) - 6 \, a b^{3} \tan \left (c\right )^{2} + 6 \, a^{3} b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) - 6 \, a b^{3} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) - 18 \, a^{2} b^{2} \tan \left (d x\right ) + 3 \, b^{4} \tan \left (d x\right ) - 18 \, a^{2} b^{2} \tan \left (c\right ) + 3 \, b^{4} \tan \left (c\right ) - 6 \, a b^{3}}{3 \, {\left (d \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 3 \, d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 3 \, d \tan \left (d x\right ) \tan \left (c\right ) - d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(d*x+c))^4,x, algorithm="giac")

[Out]

1/3*(3*a^4*d*x*tan(d*x)^3*tan(c)^3 - 18*a^2*b^2*d*x*tan(d*x)^3*tan(c)^3 + 3*b^4*d*x*tan(d*x)^3*tan(c)^3 - 6*a^
3*b*log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) +
1)/(tan(c)^2 + 1))*tan(d*x)^3*tan(c)^3 + 6*a*b^3*log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2
*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1))*tan(d*x)^3*tan(c)^3 - 9*a^4*d*x*tan(d*x)^2*tan
(c)^2 + 54*a^2*b^2*d*x*tan(d*x)^2*tan(c)^2 - 9*b^4*d*x*tan(d*x)^2*tan(c)^2 + 6*a*b^3*tan(d*x)^3*tan(c)^3 + 18*
a^3*b*log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c)
+ 1)/(tan(c)^2 + 1))*tan(d*x)^2*tan(c)^2 - 18*a*b^3*log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x
)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1))*tan(d*x)^2*tan(c)^2 - 18*a^2*b^2*tan(d*x)^3
*tan(c)^2 + 3*b^4*tan(d*x)^3*tan(c)^2 - 18*a^2*b^2*tan(d*x)^2*tan(c)^3 + 3*b^4*tan(d*x)^2*tan(c)^3 + 9*a^4*d*x
*tan(d*x)*tan(c) - 54*a^2*b^2*d*x*tan(d*x)*tan(c) + 9*b^4*d*x*tan(d*x)*tan(c) + 6*a*b^3*tan(d*x)^3*tan(c) - 6*
a*b^3*tan(d*x)^2*tan(c)^2 + 6*a*b^3*tan(d*x)*tan(c)^3 - b^4*tan(d*x)^3 - 18*a^3*b*log(4*(tan(d*x)^4*tan(c)^2 -
 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1))*tan(d*x)*tan(
c) + 18*a*b^3*log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)
*tan(c) + 1)/(tan(c)^2 + 1))*tan(d*x)*tan(c) + 36*a^2*b^2*tan(d*x)^2*tan(c) - 9*b^4*tan(d*x)^2*tan(c) + 36*a^2
*b^2*tan(d*x)*tan(c)^2 - 9*b^4*tan(d*x)*tan(c)^2 - b^4*tan(c)^3 - 3*a^4*d*x + 18*a^2*b^2*d*x - 3*b^4*d*x - 6*a
*b^3*tan(d*x)^2 + 6*a*b^3*tan(d*x)*tan(c) - 6*a*b^3*tan(c)^2 + 6*a^3*b*log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)
^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1)) - 6*a*b^3*log(4*(tan(d*x
)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1))
 - 18*a^2*b^2*tan(d*x) + 3*b^4*tan(d*x) - 18*a^2*b^2*tan(c) + 3*b^4*tan(c) - 6*a*b^3)/(d*tan(d*x)^3*tan(c)^3 -
 3*d*tan(d*x)^2*tan(c)^2 + 3*d*tan(d*x)*tan(c) - d)

________________________________________________________________________________________

Mupad [B]
time = 3.89, size = 167, normalized size = 1.62 \begin {gather*} \frac {b^4\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,d}-\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (b^4-6\,a^2\,b^2\right )}{d}-\frac {\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )\,\left (2\,a\,b^3-2\,a^3\,b\right )}{d}+\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (-a^2+2\,a\,b+b^2\right )\,\left (a^2+2\,a\,b-b^2\right )}{a^4-6\,a^2\,b^2+b^4}\right )\,\left (-a^2+2\,a\,b+b^2\right )\,\left (a^2+2\,a\,b-b^2\right )}{d}+\frac {2\,a\,b^3\,{\mathrm {tan}\left (c+d\,x\right )}^2}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(c + d*x))^4,x)

[Out]

(b^4*tan(c + d*x)^3)/(3*d) - (tan(c + d*x)*(b^4 - 6*a^2*b^2))/d - (log(tan(c + d*x)^2 + 1)*(2*a*b^3 - 2*a^3*b)
)/d + (atan((tan(c + d*x)*(2*a*b - a^2 + b^2)*(2*a*b + a^2 - b^2))/(a^4 + b^4 - 6*a^2*b^2))*(2*a*b - a^2 + b^2
)*(2*a*b + a^2 - b^2))/d + (2*a*b^3*tan(c + d*x)^2)/d

________________________________________________________________________________________